package karstenTest;

public class CycleTest {

	int framesize;
	int frameOffset;
	int numbOfVertices;
	
	
	public CycleTest(int framesize, int frameOffset, int numbOfVertices) {
		super();
		this.framesize = framesize;
		this.frameOffset = frameOffset;
		this.numbOfVertices = numbOfVertices;
	}

	public void calcCycle(){
		double steps = (2 * Math.PI) / numbOfVertices;
		double radius = (framesize - (2 * frameOffset));
		
		
		for (int i = 0; i < numbOfVertices; i++) {
			double x = frameOffset + radius	+ Math.round((radius * Math.sin(i * steps)));
			double y = frameOffset + radius	+ Math.round((radius * Math.cos(i * steps)));
			
//			System.out.println("Step: " + steps);
//			System.out.println(i + "(i) * Steps: " + i * steps);
//			System.out.println("Sin: " + Math.sin(i * steps));
//			System.out.println("radius * sin: " + radius * Math.sin(i * steps));
//			System.out.println("Round: " + Math.round((radius * Math.sin(i * steps))));
			
			System.out.println("Iteration i: "+ i+ "X: " + x + " Y: " +y);
		}
	}
	
	
	public static void main(String[] args) {
		CycleTest ct = new CycleTest(200, 20, 10);
		
		ct.calcCycle();
	}
}
